﻿using System.Linq;
using Raven.Abstractions.Indexing;
using Raven.Client.Indexes;
using TimeTracker.Entities;

namespace TimeTracker.Persistence.Indexes
{
    public class EntriesFullTextSearchIndex : AbstractIndexCreationTask<Entry>
    {
        public EntriesFullTextSearchIndex()
        {
            Map = entries => from entry in entries
                             select new { entry.Id, entry.Description };

            Index(x => x.Description, FieldIndexing.Analyzed);
        }
    }
}
